var QQMapWX = require('../../qqmap/qqmap-wx-jssdk.js');
var qqmapsdk;

// pages/zan/zan.js
Page({

  /**
   * 页面的初始数据
   */
  data: {
  
  },

  /**
   * 生命周期函数--监听页面加载
   */
  onLoad: function (options) {
  
  },

  zanclick:function(e){

    //取得当前地理位置
    qqmapsdk = new QQMapWX({
      key: 'CSHBZ-L5ZW6-ZJ7SC-MLB32-5VNGF-U7BLT'
    });
    wx.getLocation({
      type: 'wgs84',
      success: function (res) {
        console.log(res);
        qqmapsdk.reverseGeocoder({
          location: {
            latitude: res.latitude,
            longitude: res.longitude
          },
          success: function (res) {
            var province = res.result.address_component.province;
            var city = res.result.address_component.city;
            //查询下省名字相同的选择上
            console.log(province, city);

          }
        });
        //
      }
    });
  }
})